package com.bocloud.cmp.dao;

import java.util.List;
import java.util.Map;

import com.bocloud.cmp.entity.resource.DataCenter;
import com.bocloud.common.model.Param;
import com.bocloud.common.model.SimpleBean;
import com.bocloud.database.core.intf.GenericDao;

/**
 * 数据中心抽象DAO接口
 * 
 * @author wei wei
 * @version 1.0
 * @since 2016.02.27
 */
public interface DataCenterDao extends GenericDao<DataCenter, Long> {

	/**
	 * 查询机房详细
	 * 
	 * @param id
	 *            the id
	 * @return the data center
	 * @throws Exception
	 */
	public DataCenter query(Long id) throws Exception;

	/**
	 * 查询数据中心列表
	 * 
	 * @param page
	 *            the page
	 * @param rows
	 *            the rows
	 * @param params
	 *            the params
	 * @param sorter
	 *            the sorter
	 * @return the result
	 * @throws Exception
	 */
	public List<DataCenter> list(int page, int rows, List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 查询数据中心简易列表
	 * 
	 * @param params
	 *            the params
	 * @param sorter
	 *            the sorter
	 * @return the bean
	 * @throws Exception
	 */
	public List<SimpleBean> list(List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 符合条件的数据条数
	 * 
	 * @param params
	 *            the params
	 * @return
	 * @throws Exception
	 */
	public int count(List<Param> params) throws Exception;

	/**
	 * 删除数据中心
	 * 
	 * @param id
	 *            the id
	 * @param userId
	 *            the user id
	 * @return
	 * @throws Exception
	 */
	public boolean remove(Long id, Long userId) throws Exception;
}
